package online.afeibaili.storebackendframework.model

import jakarta.persistence.Entity
import jakarta.persistence.Id
import jakarta.persistence.Table


/**
 * 优惠券实体类
 *
 *@author AfeiBaili
 *@version 2025/10/25 21:11
 */

@Entity
@Table(name = "coupon")
class CouponEntity() {
    @Id
    //创建时间
    var createTime: Long = 0

    //优惠折扣 和 优惠金额冲突
    var discount: Double = 0.0

    //过期时间
    var expireTime: Long = 0

    //优惠金额
    var reprice: Double = 0.0

    //数量
    var quantity: Int = 0

    //最低优惠金额
    var min: Double = 0.0

    //持有优惠券的人的id
    var name: String = ""

    constructor(discount: Double, expireTime: Long, reprice: Double) : this() {
        this.createTime = System.currentTimeMillis()
        this.discount = discount
        this.expireTime = expireTime
        this.reprice = reprice
    }
}